home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Sample Controls / BDiamond / C3DTextView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-12-20  |  1.1 KB  |  45 lines  |  [TEXT/CWIE]

  1. #ifndef __C3DTextView__
  2. #define __C3DTextView__
  3. #define __C3DTEXTVIEW__
  4.  
  5. #include "C3DView.h"
  6.  
  7. //------------------------------------------------------------------------------
  8. //    Class definition
  9. //------------------------------------------------------------------------------
  10.  
  11. class C3DTextView : public C3DView
  12. {
  13.  
  14.     //    Initialization and cleanup
  15.     public:
  16.         C3DTextView();
  17.         
  18.     //    Drawing
  19.     public:
  20.         virtual void     Draw3D(const DrawContext * context);    // override
  21.         
  22.     //    Access
  23.     public:
  24.         void            SetText ( const DrawContext * context, const char * text, Boolean redraw );
  25.         void            GetText(char * text);
  26.         
  27.         void            SetTextColor(const DrawContext * context, const RGBColor & textColor, Boolean redraw);
  28.         void            GetTextColor(RGBColor * textColor);
  29.         
  30.         void            SetFontParams(void);
  31.         
  32.     protected:
  33.         // calculates mTextLocation.  returns true if the text fits in the view
  34.         Boolean            PlaceText(const DrawContext * context, const StringPtr text);
  35.         
  36.     //    Instance variables
  37.     protected:
  38.         Str255            mText;            // the text to be displayed    
  39.         RGBColor        mTextColor;        // the color of the text
  40.         Point            mTextLocation;    // where the text gets drawn
  41.         
  42. };
  43.  
  44. #endif __C3DTextView__
  45.